<template>
    <div class="container">
        <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane v-for="item in tabs" :label="item.title" :name="item.name">
                <Components :type="item.name"></Components>
            </el-tab-pane>
        </el-tabs>
    </div>

</template>

<script>
    import axios from 'axios'
    import Components from "../../components/utils/Components";
    export default {
        name: "PersonnelFile",
        components:{
            Components
        },
        data() {
            return {
                activeName: 'InJob',
                tabs:[
                    {
                        'title':"人事档案（在职）",
                        'name':'InJob'
                    },{
                        'title':"人事档案（离职）",
                        'name':'second'
                    },{
                        'title':"人事档案查询",
                        'name':'third'
                    },{
                        'title':"未建档案人员查询",
                        'name':'fourth'
                    },
                ]
            };
        },
        methods:{
            getData(){
                axios.get('/api/a/test')
                    .then(function (response) {
                        console.log(response.data);
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            handleClick(tab, event) {
                console.log(tab, event);
            }
        },
        mounted(){
            this.getData()
        }
    }
</script>

<style scoped lang="less">
    .container{
        padding: 5px;
        height:100%;
        /deep/.el-tabs{
            height:100%;
        }
    }
</style>